# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-torf
_pkgname=torf
pkgver=4.3.0
_pyver=3.13
pkgrel=1
pkgdesc='Python 3 module for creating and parsing torrent files and magnet URIs.'
arch=('any')
url='https://pypi.org/project/torf/#files'
license=('MIT')
depends=('python' 'python-flatbencode')
makedepends=('python-build' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('cb92a19708d71e8f0ad2629d14f4b8c18a9089ec6b34cbe8145e5b4b7a332f26729f8dd21798a73b85b8db0c61bec3fbcea88661d224d1d1be79f6ad5375513b')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

	pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname

  #chmod 644 \
  #  "$pkgdir/usr/lib/python$_pyver/site-packages/torf-4.3.0-py$_pyver.egg-info/"*
}

